﻿using System.Web.Mvc;
using FriendStar.Code;
using FriendStar.Application.VBaseData;
using FriendStar.Domain.Entity.VBaseData;

namespace FriendStar.Web.Areas.VBaseData.Controllers
{
    public class V_CPK_45_HZ_StoCPKListAccoController : ControllerBase
    {
        //
        // GET: /VBaseData/V_CPK_45_HZ_StoCPKListAcco/
        private V_CPK_45_HZ_StoCPKListAccoApp v_cpk_45_HZ_StoCPKListAccoApp = new V_CPK_45_HZ_StoCPKListAccoApp();
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetGridJson(string keyword)    
        {
            var data = v_cpk_45_HZ_StoCPKListAccoApp.GetList();
            return Content(data.ToJson());
        }

        public ActionResult GetParameterGridJson(Pagination pagination, string companyname, string productionno, string fcurdate, string fvoucherno,string ledgerdate)
        {
            var data = new
            {
                rows = v_cpk_45_HZ_StoCPKListAccoApp.GetParameterGridJson(pagination, companyname, productionno, fcurdate, fvoucherno, ledgerdate),
                total = pagination.total,
                page = pagination.page,
                records = pagination.records
            };
            return Content(data.ToJson());
        }
        public ActionResult GetOutParameterGridJson(Pagination pagination, string companyname, string productionno, string fcurdate, string fvoucherno, string ledgerdate)
        {
            var data = new
            {
                rows = v_cpk_45_HZ_StoCPKListAccoApp.GetOutParameterGridJson(pagination, companyname, productionno, fcurdate, fvoucherno, ledgerdate),
                total = pagination.total,
                page = pagination.page,
                records = pagination.records
            };
            return Content(data.ToJson());
        }
    }
}
